<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8" />
    <title>login lot</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <link rel="stylesheet" href="./sdk/sdk.css" />
    <link rel="stylesheet" href="./sdk/helper.css" />
    <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11，如果要支持 IE11 请引用这个 css，并把前面那个删了 -->
    <!-- <link rel="stylesheet" href="sdk-ie11.css" /> -->
    <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果，所以可能有细节功能用不了，如果发现请报 issue -->
    <style>
        html,
        body,
        .app-wrapper {
            position: relative;
            width: 100%;
            height: 100%;
            margin: 0;
            padding: 0;
        }

    </style>
</head>

<body>
    <div id="root" class="app-wrapper"></div>
    <script src="./sdk/sdk.js"></script>
    <script type="text/javascript">
        (function () {
            let amis = amisRequire('amis/embed');
            let amisJSON = {
                "type": "page",
                "toolbar": [{
                    "type": "form",
                    "panelClassName": "mb-0",
                    "title": "",
                    "controls": [{
                            "type": "select",
                            "label": "区域",
                            "name": "businessLineId",
                            "selectFirst": true,
                            "mode": "inline",
                            "options": [
                                "北京",
                                "上海"
                            ],
                            "checkAll": false
                        },
                        {
                            "label": "时间范围",
                            "type": "date-range",
                            "name": "dateRange",
                            "inline": true,
                            "value": "-1month,+0month",
                            "inputFormat": "YYYY-MM-DD",
                            "format": "YYYY-MM-DD",
                            "closeOnSelect": true,
                            "clearable": false
                        }
                    ],
                    "actions": [],
                    "mode": "inline",
                    "target": "mainPage",
                    "submitOnChange": true,
                    "submitOnInit": true
                }],
                "body": [{
                        "type": "grid",
                        "columns": [{
                                "type": "panel",
                                "className": "h-full",
                                "body": {
                                    "type": "tabs",
                                    "tabs": [{
                                            "title": "消费趋势",
                                            "tab": [{
                                                "type": "chart",
                                                "config": {
                                                    "title": {
                                                        "text": "消费趋势"
                                                    },
                                                    "tooltip": {},
                                                    "xAxis": {
                                                        "type": "category",
                                                        "boundaryGap": false,
                                                        "data": [
                                                            "一月",
                                                            "二月",
                                                            "三月",
                                                            "四月",
                                                            "五月",
                                                            "六月"
                                                        ]
                                                    },
                                                    "yAxis": {},
                                                    "series": [{
                                                        "name": "销量",
                                                        "type": "line",
                                                        "areaStyle": {
                                                            "color": {
                                                                "type": "linear",
                                                                "x": 0,
                                                                "y": 0,
                                                                "x2": 0,
                                                                "y2": 1,
                                                                "colorStops": [{
                                                                        "offset": 0,
                                                                        "color": "rgba(84, 112, 197, 1)"
                                                                    },
                                                                    {
                                                                        "offset": 1,
                                                                        "color": "rgba(84, 112, 197, 0)"
                                                                    }
                                                                ],
                                                                "global": false
                                                            }
                                                        },
                                                        "data": [
                                                            5,
                                                            20,
                                                            36,
                                                            10,
                                                            10,
                                                            20
                                                        ]
                                                    }]
                                                }
                                            }]
                                        },
                                        {
                                            "title": "账户余额",
                                            "tab": "0"
                                        }
                                    ]
                                }
                            },
                            {
                                "type": "panel",
                                "className": "h-full",
                                "body": [{
                                    "type": "chart",
                                    "config": {
                                        "title": {
                                            "text": "使用资源占比"
                                        },
                                        "series": [{
                                            "type": "pie",
                                            "data": [{
                                                    "name": "BOS",
                                                    "value": 70
                                                },
                                                {
                                                    "name": "CDN",
                                                    "value": 68
                                                },
                                                {
                                                    "name": "BCC",
                                                    "value": 48
                                                },
                                                {
                                                    "name": "DCC",
                                                    "value": 40
                                                },
                                                {
                                                    "name": "RDS",
                                                    "value": 32
                                                }
                                            ]
                                        }]
                                    }
                                }]
                            }
                        ]
                    },
                    {
                        "type": "crud",
                        "className": "m-t-sm",
                        "api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/sample",
                        "columns": [{
                                "name": "id",
                                "label": "ID"
                            },
                            {
                                "name": "engine",
                                "label": "Rendering engine"
                            },
                            {
                                "name": "browser",
                                "label": "Browser"
                            },
                            {
                                "name": "platform",
                                "label": "Platform(s)"
                            },
                            {
                                "name": "version",
                                "label": "Engine version"
                            },
                            {
                                "name": "grade",
                                "label": "CSS grade"
                            }
                        ]
                    }
                ]
            };
            let amisScoped = amis.embed('#root', amisJSON);
        })();

    </script>
</body>

</html>
